@import "mixin_helpers";
@import "font-awesome-mixins";

$border-color: #EAEBEF;
$head-color: #666;
$head-border-color: #B5B7C3;

table.dataTable {
  margin: 0 auto;
  clear: both;
  width: 100%;

  thead th {
    padding: 0;
    height: 30px;
    line-height: 30px;
    font-weight: normal;
    color: $head-color;
    cursor: pointer;
    *cursor: hand;
    font-size: 12px;
    font-weight: 600;
    @include text-shadow-bottom(#fff);
    @include box-shadow(0 1px 0px #fff inset);
  }

  tfoot th {
    padding: 3px 18px 3px 10px;
    font-weight: 600;
  }

  td {
    padding: 7px 11px;
    &.center, &.dataTables_empty {
      text-align: center;
    }
  }

  tbody tr td {
    border-left: 1px solid $border-color;
  }

  thead tr th {
    border-left: 1px solid $head-border-color;
    border-bottom: 1px solid $head-border-color;
    border-top: 1px solid lighten($head-border-color, 5);
  }

  tbody tr td:first-child {
    border-left: none;
  }

  thead tr {
    @include std-bg($header-gradient-top, $header-gradient-bottom);

    th:first-child {
      border-left: none;
    }
    &:first-child {
      margin: 0;
      padding: 0;
      border-top: none;
    }
  }
  tr {
    border-top: 1px solid $border-color;
    &.even {
      background-color: #F3F4F8;
    }
  }
}

.dataTables_wrapper {
  position: relative;
  clear: both;
  *zoom: 1;
}

.dataTables_length {
  float: right;
  margin: 0;

  label {
    line-height: 61px;
    height: 61px;
    margin: 0;
  }

  select {
    width: auto;
  }

  div.selector {
    width: auto;
  }
}

.entries-per-page {
  float: left;
  margin: 0px 15px 0 0;
}

.dataTables_filter {

  float: left;
  font-size: 11px;
  text-align: left;
  margin: 0;
  position: relative;

  label {
    line-height: 61px;
    height: 61px;
    margin-bottom: 0;
  }

  label > span {
    display: block;
    float: left;
    padding-top: 1px;
  }
  input[type=text] {
    height: auto;
    padding: 2px 20px 2px 7px;
    margin-left: 15px;
    margin-bottom: 0;
    width: 180px;
    background: #f9f9f9;
    border: 1px solid #d7d7d7;
  }
}

.dataTables_info {
  clear: both;
  float: left;
  padding: 10px 0;
}

.table-footer {
  clear: both;
  padding: 8px 12px;
  height: 36px;
  font-size: 11px;
  color: #666;
  border-top: 1px solid #cdcdcd;
  @include border-bottom-right-radius(3px);
  @include border-bottom-left-radius(3px);
  background: $header-gradient-top;
  @include std-bg($header-gradient-top, $header-gradient-bottom);
}


.table-header {
  border-bottom: 1px solid $border-color;
  height: 61px;
  @include box-shadow(0 1px 0 #fff inset);
  clear: both;
  padding: 0 16px;
  font-size: 11px;
  color: #666;
  @include std-bg($header-gradient-top, $header-gradient-bottom);
}

.dataTables_paginate {
  float: right;
  margin-top: 7px;
}

.paging_full_numbers {
  height: 22px;
  line-height: 22px;

  a {
    &.paginate_button, &.paginate_active {

      border-top: 1px solid #E2E2E2;
      border-left: 1px solid #C9C9C9;
      border-right: 1px solid #C9C9C9;
      border-bottom: 1px solid #AEAEAE;

      @include border-radius(3px);
      border-radius: 3px;
      padding: 4px 7px;
      margin: 0 3px;
      cursor: pointer;
      color: #666;
      font-weight: 600;
      @include text-shadow-bottom(#fff);
      font-size: 11px;
      @include box-shadow(0 1px 0 #fff inset);
    }

    &.paginate_button {
      @include std-bg($header-gradient-top, $header-gradient-bottom);

      &:hover {
        @include std-bg(#f1f1f1, $header-gradient-bottom);
      }
    }
    &.paginate_active, &.paginate_button:active {
      border: 1px solid #AEAEAE;
      @include box-shadow(0 0 6px -1px rgba(0, 0, 0, 0.2) inset, 0 1px 0 white);
    }

    &.paginate_button_disabled {
      background: #eee;
      color: #c5c5c5;
      box-shadow: none;
      border: 1px solid #E2E2E2;;

      &:active, &:hover {
        background: #eee;
        border: 1px solid #E2E2E2;
        box-shadow: none;
      }
    }
  }



}

.sorting, .sorting_asc, .sorting_desc {
  position: relative;

  > div {
    position: relative;
    height: 20px;
    line-height: 20px;
    &:after {
      @include font-awesome-char;
      color: $head-color;
      line-height: 14px;
      width: 16px;
      height: 16px;
      position: absolute;
      right: 3px;
      top: 3px;
    }
  }


}

.sorting_asc, .sorting_desc {
  @include std-bg(#F7F8FC, #F2F3F7);
}

.sorting > div:after {
  @include icon-sort;
}

.sorting_asc > div:after {
  @include icon-sort-up;
  top: 7px;
}

.sorting_desc > div:after {
  @include icon-sort-down;
  top: 1px;
}

table.dataTable th:active {
  outline: none;
}

.dataTables_scroll {
  clear: both;
}

.dataTables_scrollBody {
  *margin-top: -1px;
  -webkit-overflow-scrolling: touch;
}